package org.bite.five_notes;

import org.bite.five_notes.Component.UserComponent;
import org.bite.five_notes.Configuration.UserConfiguration;
import org.bite.five_notes.Controller.UserController;
import org.bite.five_notes.Repository.UserRepository;
import org.bite.five_notes.Service.UserService;
import org.bite.five_notes.model.UserInfo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

//@ComponentScan("org.bite.five_notes")
@SpringBootApplication
public class FiveNotesApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext notes = SpringApplication.run(FiveNotesApplication.class, args);
//        UserController UC = notes.getBean(UserController.class);
//        UserController UC = (UserController)notes.getBean("userController");//五大注解命名规则会把User编程user 若是USer 则不会变
        UserController UC = notes.getBean("userController",UserController.class);//五大注解命名规则会把User编程user 若是USer 则不会变
        UC.sayHi();

//        UserService US = notes.getBean(UserService.class);
//        UserService US = (UserService)notes.getBean("userService");
        /*UserService US = notes.getBean("userService",UserService.class);
        US.sayHi();*/

//        UserRepository UR = notes.getBean(UserRepository.class);
//        UserRepository UR = (UserRepository)notes.getBean("userRepository");
        /*UserRepository UR = notes.getBean("userRepository",UserRepository.class);
        UR.sayHi();
*/
//        UserConfiguration Uc = notes.getBean(UserConfiguration.class);
//        UserConfiguration Uc = (UserConfiguration)notes.getBean("userConfiguration");
        /*UserConfiguration Uc = notes.getBean("userConfiguration",UserConfiguration.class);
        Uc.sayHi();
*/
//        UserComponent Uct = notes.getBean(UserComponent.class);
//        UserComponent Uct = (UserComponent)notes.getBean("userComponent");
        /*UserComponent Uct = notes.getBean("userComponent",UserComponent.class);
        Uct.sayHi();*/
//        UserInfo Info = notes.getBean("h1",UserInfo.class);
//        UserInfo Info22 = notes.getBean("h2",UserInfo.class);
//        UserInfo Info33 = notes.getBean("h3",UserInfo.class);
//        UserInfo Info2 = notes.getBean("myName2",UserInfo.class);
//        UserInfo Info3 = notes.getBean("myName3",UserInfo.class);
//        System.out.println(Info);
//        System.out.println(Info22);
//        System.out.println(Info33);
//        System.out.println(Info2);
//        System.out.println(Info3);
    }

}
